import request from '@/utils/request'
export const reqGetRoleList = (page, pagesize) => {
  return request.get('/sys/role', { params: { page, pagesize }})
}
export const reqDeleteRole = id => {
  return request.delete(`/sys/role/${id}`)
}
export function reqAddRole(data) {
  return request({
    url: '/sys/role',
    data,
    method: 'post'
  })
}
export function reqUpdateRole(data) {
  return request({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}

/**
   * 根据 id 获取角色详情, 用于回显
   * **/
export function reqGetRoleDetail(id) {
  return request({
    method: 'get',
    url: `/sys/role/${id}`
  })
}
